home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / UTIL / TouchMe 1.1.1.sit / touchMe 1.11 Folder / CW9 PP source / source / TouchMeAppleEvents.r < prev    next >
Text File  |  1996-08-08  |  10KB  |  376 lines

  1. // ==================================================
  2. //    TouchMeAppleEvents.r
  3. //    Copyright (C) 1996 Mizutori Tetsuya, July 4 1996.
  4. // ==================================================
  5. //    All documents are pretty-printed in Geneva 10-point font.
  6.  
  7. #define SystemSevenOrLater    TRUE
  8.  
  9. #include <Types.r>
  10. #include <SysTypes.r>
  11. #include <AEObjects.r>
  12. #include <AERegistry.r>
  13. #include <AEUserTermTypes.r>
  14. #include <AppleEvents.r>
  15. #include <ASRegistry.r>
  16.  
  17. #include <PowerPlant.r>
  18.  
  19. #include <AEPowerPlantSuite.h>
  20. #include <AETextSuite.h>
  21. #include <AEDebugSuite.h>
  22.  
  23. //    Macros for some common patterns...
  24. //    (the files below assume the presence of these macros)
  25. #define Reserved4_        reserved, reserved, reserved, reserved
  26. #define Reserved8_        Reserved4_, Reserved4_
  27. #define Reserved12_        Reserved8_, Reserved4_
  28. #define ReservedVerb_    Reserved8_, verbEvent, reserved, reserved, reserved
  29. #define ReservedPrep_    Reserved8_, reserved, prepositionParam, notFeminine, notMasculine, singular
  30. #define ReservedApost_    Reserved8_, noApostrophe, notFeminine, notMasculine, singular
  31.  
  32.  
  33. // TouchMe AppleEvent Terminology
  34.  
  35. #define  ae_GetPrefs                    10001        // 'getp'
  36. #define  ae_SetPrefs                    10002        // 'setp'
  37. #define  ae_LoadPrefs                    10003        // 'lodp'
  38. #define  ae_SavePrefs                    10004        // 'savp'
  39. #define  ae_Touch                    10005        // 'toch'
  40. #define  ae_Fetch                    10006        // 'ftch'
  41.  
  42.  
  43. #define  kAETouchMeSuite                'MzTm'
  44. #define  kAEGetPrefs                    'getp'
  45. #define  kAESetPrefs                    'setp'
  46. #define  kAELoadPrefs                    'lodp'
  47. #define  kAESavePrefs                    'savp'
  48. #define  kAETouch                    'toch'
  49. #define  kAEFetch                    'ftch'
  50.  
  51. #define  cTouchMePref                'pref'
  52. #define  pPref_Enabled                'penb'
  53. #define  pPref_Flag                    'pflg'
  54. #define  pPref_Value                    'pval'
  55.  
  56. #define  cTouchMeStamp                'stmp'
  57. #define  pStamp_Creation                'crtd'
  58. #define  pStamp_Modification            'modd'
  59.  
  60. #define  typeAETouchMeType            'Etyp'
  61. #define  kEnumType_Creation            'crtT'
  62. #define  kEnumType_Modification            'modT'
  63.  
  64. #define  typeAETouchMeFlag                'Eflg'
  65. #define  kEnumFlag_Current            'curr'
  66. #define  kEnumFlag_Excact                'dval'
  67. #define  kEnumFlag_First                'frst'
  68. #define  kEnumFlag_FirstSet            'scnd'
  69.  
  70.  
  71. // --------------------------------------------------
  72. //    ・ Apple Event Dispatching Table
  73. // --------------------------------------------------
  74.  
  75. resource 'aedt' (1000, "touchMe Suite") {
  76.     {    /* array: 6 elements */
  77.         /* [1] */
  78.         kAETouchMeSuite,    kAEGetPrefs,    ae_GetPrefs,
  79.         /* [2] */
  80.         kAETouchMeSuite,    kAESetPrefs,    ae_SetPrefs,
  81.         /* [3] */
  82.         kAETouchMeSuite,    kAELoadPrefs,    ae_LoadPrefs,
  83.         /* [4] */
  84.         kAETouchMeSuite,    kAESavePrefs,    ae_SavePrefs,
  85.         /* [5] */
  86.         kAETouchMeSuite,    kAETouch,        ae_Touch,
  87.         /* [6] */
  88.         kAETouchMeSuite,    kAEFetch,        ae_Fetch
  89.     }
  90. };
  91.  
  92.  
  93. // --------------------------------------------------
  94. //    ・ Apple Event Terminology Extension
  95. // --------------------------------------------------
  96.  
  97. resource 'aete' (0, "English") {
  98.     0x01,                                    // major version in BCD
  99.     0x10,                                    // minor version in BCD
  100.     english,                                    // language code
  101.     roman,                                    // script code
  102.     {    /* array Suites: 2 elements */
  103.         /* [1] */
  104.         "Required Suite",                        // suite name
  105.         "Terms that every application should support",    // suite description
  106.         kAERequiredSuite,                        // suite ID
  107.         1,                                    // suite level
  108.         1,                                    // suite version
  109.         {},    /* array Events: 0 elements */
  110.         {},    /* array Classes: 0 elements */
  111.         {},    /* array ComparisonOps: 0 elements */
  112.         {},    /* array Enumerations: 0 elements */
  113.  
  114.         /* [2] */
  115.         "touchMe Suite",                            // suite name
  116.         "Change creation & modification date time for the file",
  117.         kAETouchMeSuite,
  118.         1,
  119.         1,
  120.         {    /* array Events: 6 elements */
  121.             /* [1] */
  122.             "get prefs",                    // event name
  123.             "Get the settings information",        // event description
  124.                 kAETouchMeSuite,            // event class
  125.                 kAEGetPrefs,                // event ID
  126.             cTouchMePref,                    // reply type
  127.             "list of current settings",            // reply description
  128.                 replyRequired,                // if the reply is required
  129.                 listOfItems,                // if the reply must be a list
  130.                 notEnumerated,                // if the type is enumerated
  131.                 notTightBindingFunction,        // if the message has tight binding precedence
  132.                 ReservedVerb_,                // these 12 bits are reserved
  133.             typeAETouchMeType,                // direct param type
  134.             "creation or modification type",        // direct param description
  135.                 directParamRequired,            // if the direct param is required
  136.                 singleItem,                    // if the param must be a list
  137.                 enumerated,                // if the type is enumerated
  138.                 doesntChangeState,            // if the event changes server's state
  139.                 Reserved12_,                // these 12 bits are reserved
  140.             {},    /* array OtherParams: 0 elements */
  141.  
  142.             /* [2] */
  143.             "set prefs",                    // event name
  144.             "Set the settings information",
  145.                 kAETouchMeSuite,
  146.                 kAESetPrefs,
  147.             noReply,
  148.             "",
  149.                 replyOptional,
  150.                 singleItem,
  151.                 notEnumerated,
  152.                 notTightBindingFunction,
  153.                 ReservedVerb_,
  154.             typeAETouchMeType,
  155.             "creation or modification type",
  156.                 directParamRequired,
  157.                 singleItem,
  158.                 enumerated,
  159.                 changesState,
  160.                 Reserved12_,
  161.             {    /* array OtherParams: 1 elements */
  162.                 /* [1] */
  163.                 "to",                        // parameter name
  164.                     keyAEData,                // parameter keyword
  165.                     typeWildCard,            // parameter type
  166.                     "list of new settings",        // parameter description
  167.                         required,            // if param is optional
  168.                         singleItem,            // if the param must be a list
  169.                         notEnumerated,        // if the type is enumerated
  170.                         ReservedPrep_        // these 13 bits are reserved
  171.             },
  172.  
  173.             /* [3] */
  174.             "load prefs",                    // event name
  175.             "Load the settings from preferences file",
  176.                 kAETouchMeSuite,
  177.                 kAELoadPrefs,
  178.             noReply,
  179.             "",
  180.                 replyOptional,
  181.                 singleItem,
  182.                 notEnumerated,
  183.                 notTightBindingFunction,
  184.                 ReservedVerb_,
  185.             noParams,
  186.             "",
  187.                 directParamOptional,
  188.                 singleItem,
  189.                 notEnumerated,
  190.                 doesntChangeState,
  191.                 Reserved12_,
  192.             {},    /* array OtherParams: 0 elements */
  193.  
  194.             /* [4] */
  195.             "save prefs",                    // event name
  196.             "Save the settings to preferences file",
  197.                 kAETouchMeSuite,
  198.                 kAESavePrefs,
  199.             noReply,
  200.             "",
  201.                 replyOptional,
  202.                 singleItem,
  203.                 notEnumerated,
  204.                 notTightBindingFunction,
  205.                 ReservedVerb_,
  206.             noParams,
  207.             "",
  208.                 directParamOptional,
  209.                 singleItem,
  210.                 notEnumerated,
  211.                 doesntChangeState,
  212.                 Reserved12_,
  213.             {},    /* array OtherParams: 0 elements */
  214.  
  215.             /* [5] */
  216.             "touch",                        // event name
  217.             "Touch the files",
  218.                 kAETouchMeSuite,
  219.                 kAETouch,
  220.             noReply,
  221.             "",
  222.                 replyOptional,
  223.                 singleItem,
  224.                 notEnumerated,
  225.                 notTightBindingFunction,
  226.                 ReservedVerb_,
  227.             typeAlias,
  228.             "list of objects to touch",
  229.                 directParamRequired,
  230.                 listOfItems,
  231.                 notEnumerated,
  232.                 changesState,
  233.                 Reserved12_,
  234.             {},    /* array OtherParams: 0 elements */
  235.  
  236.             /* [6] */
  237.             "fetch",                        // event name
  238.             "Fetch the date time stamp of file, and set the fields",
  239.                 kAETouchMeSuite,
  240.                 kAEFetch,
  241.             cTouchMeStamp,
  242.             "creation and modification date time",
  243.                 replyRequired,
  244.                 listOfItems,
  245.                 notEnumerated,
  246.                 notTightBindingFunction,
  247.                 ReservedVerb_,
  248.             typeAlias,
  249.             "list of objects to fetch",
  250.                 directParamRequired,
  251.                 listOfItems,
  252.                 notEnumerated,
  253.                 changesState,
  254.                 Reserved12_,
  255.             {}    /* array OtherParams: 0 elements */
  256.  
  257.         },
  258.  
  259.         {    /* array Classes: 2 elements */
  260.             /* [1] */
  261.             "prefs",                        // class name
  262.             cTouchMePref,                    // class ID
  263.             "Settings information",            // class description
  264.             {    /* array Properties: 3 elements */
  265.                 /* [1] */
  266.                 "enabled",                    // property name
  267.                     pPref_Enabled,            // property ID
  268.                     typeBoolean,            // property class
  269.                     "",                    // property description
  270.                         reserved,
  271.                         singleItem,            // if the property must be a list
  272.                         notEnumerated,        // if the type is enumerated
  273.                         readWrite,            // can read or write it
  274.                         ReservedApost_,        // these 12 bits are reserved
  275.  
  276.                 /* [2] */
  277.                 "flag",                    // property name
  278.                     pPref_Flag,
  279.                     typeAETouchMeFlag,
  280.                     "",
  281.                         reserved,
  282.                         singleItem,
  283.                         enumerated,
  284.                         readWrite,
  285.                         ReservedApost_,
  286.  
  287.                 /* [3] */
  288.                 "value",                    // property name
  289.                     pPref_Value,
  290.                     typeLongDateTime,
  291.                     "",
  292.                         reserved,
  293.                         singleItem,
  294.                         notEnumerated,
  295.                         readWrite,
  296.                         ReservedApost_
  297.             },
  298.             {},    /* array Elements: 0 elements */
  299.  
  300.             /* [2] */
  301.             "time stamp",                    // class name
  302.             cTouchMeStamp,
  303.             "Creation and Modification date time",
  304.             {    /* array Properties: 2 elements */
  305.                 /* [1] */
  306.                 "creation date",                // property name
  307.                     pStamp_Creation,
  308.                     typeLongDateTime,
  309.                     "creation date",
  310.                         reserved,
  311.                         singleItem,
  312.                         notEnumerated,
  313.                         readWrite,
  314.                         ReservedApost_,
  315.  
  316.                 /* [2] */
  317.                 "modification date",            // property name
  318.                     pStamp_Modification,
  319.                     typeLongDateTime,
  320.                     "modification date",
  321.                         reserved,
  322.                         singleItem,
  323.                         notEnumerated,
  324.                         readWrite,
  325.                         ReservedApost_
  326.             },
  327.             {},    /* array Elements: 0 elements */
  328.  
  329.         },
  330.  
  331.         {},    /* array ComparisonOps: 0 elements */
  332.  
  333.         {    /* array Enumerations: 2 elements */
  334.             /* [1] */
  335.             typeAETouchMeType,                    // Enumeration ID
  336.             {    /* array Enumerators: 2 elements */
  337.                 /* [1] */
  338.                 "creation",                        // Enumerator name
  339.                     kEnumType_Creation,            // Enumerator ID
  340.                     "creation type",                // Enumerator comment
  341.  
  342.                 /* [2] */
  343.                 "modification",                    // Enumerator name
  344.                     kEnumType_Modification,
  345.                     "modification type"
  346.             },
  347.  
  348.             /* [2] */                            // Enumeration ID
  349.             typeAETouchMeFlag,
  350.             {    /* array Enumerators: 4 elements */
  351.                 /* [1] */
  352.                 "current",                        // Enumerator name
  353.                     kEnumFlag_Current,
  354.                     "by current date time",
  355.  
  356.                 /* [2] */
  357.                 "exact",                        // Enumerator name
  358.                     kEnumFlag_Excact,
  359.                     "by exact date time",
  360.  
  361.                 /* [3] */
  362.                 "firstone",                        // Enumerator name
  363.                     kEnumFlag_First,
  364.                     "by first item",
  365.  
  366.                 /* [4] */
  367.                 "firstset",                        // Enumerator name
  368.                     kEnumFlag_FirstSet,
  369.                     "by first item and set"
  370.             }
  371.         }
  372.     }
  373. };
  374.  
  375. // end of resources
  376.